package spring.mvc.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * SpringMVC配置类，在该类中实现对SpringMVC的相关配置
 * 开启WebMvc功能，WebMvc相关配置就可以起作用
 */

@Configuration
@EnableWebMvc
@ComponentScan("spring.mvc.controller")
//开启MVC功能
public class MvcConfig implements WebMvcConfigurer {
    //放行静态资源
    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }
}
